exports.getJSON = function(url, fn){
	var request = new XMLHttpRequest();
	request.open('GET', url, true);

	request.onload = function() {
	  if (request.status >= 200 && request.status < 400) {
	    var data = JSON.parse(request.responseText);

	    fn(data);
	  }
	};

	request.onerror = function() {
	};

	request.send();
}
exports.getScript = function(url, fn){
	var oHead = document.getElementsByTagName("head")[0],
		oScript = document.createElement("script");

	oScript.id = "sina-weather";
	oScript.type = "text/javascript";
	oScript.src = url;
	oHead.appendChild(oScript);
	
	oScript.onload = oScript.onreadystatechange = function(){
		if (!this.readyState || this.readyState === "loaded" || this.readyState === "complete") {
			fn();
		}
	}
};